feat: Implement dynamic weighted RPC load balancing for enhanced resilience#6128
Merged
DaMandal0rian merged 2 commits intofeature/add-weighted-random-steering-load-balancingfrom Jan 22, 2026
Conversation
…lience This commit introduces dynamic weight adjustment for RPC providers, improving failover and resilience by adapting to real-time provider health. Key changes include: - Introduced a `Health` module (`chain/ethereum/src/health.rs`) to monitor RPC provider latency, error rates, and consecutive failures. - Integrated health metrics into the RPC provider selection logic in `chain/ethereum/src/network.rs`. - Dynamically adjusts provider weights based on their health scores, ensuring traffic is steered away from underperforming endpoints. - Updated `node/src/network_setup.rs` to initialize and manage health checkers for Ethereum RPC adapters. - Added `tokio` dependency to `chain/ethereum/Cargo.toml` and `node/Cargo.toml` for asynchronous health checks. - Refactored test cases in `chain/ethereum/src/network.rs` to accommodate dynamic weighting. This enhancement builds upon the existing static weighted RPC steering, allowing for more adaptive and robust RPC management. Fixes #6126
f7bdd4d to
a66d004
Compare
Collaborator
|
This PR and #6126 seem to do the same thing. Which one of these two should I review? |
Contributor
Author
Collaborator
|
Can you combine the two into one PR? The base PR also needs to be rebased against latest Looking at the two PR's, the first one introduces a new way to configure weights for RPC providers, and the second one seems to make that obsolete by making decisions on dynamic rather than static data but doesn't remove the additional config. What is the interplay between them? If we are doing dynamic weight calculations, which I think is the right way to go, we should not make weights configurable that are mostly ignored. |
ea11181
into
feature/add-weighted-random-steering-load-balancing
DaMandal0rian
added a commit
that referenced
this pull request
Jan 31, 2026
…lience (#6128) * feat: Implement dynamic weighted RPC load balancing for enhanced resilience This commit introduces dynamic weight adjustment for RPC providers, improving failover and resilience by adapting to real-time provider health. Key changes include: - Introduced a `Health` module (`chain/ethereum/src/health.rs`) to monitor RPC provider latency, error rates, and consecutive failures. - Integrated health metrics into the RPC provider selection logic in `chain/ethereum/src/network.rs`. - Dynamically adjusts provider weights based on their health scores, ensuring traffic is steered away from underperforming endpoints. - Updated `node/src/network_setup.rs` to initialize and manage health checkers for Ethereum RPC adapters. - Added `tokio` dependency to `chain/ethereum/Cargo.toml` and `node/Cargo.toml` for asynchronous health checks. - Refactored test cases in `chain/ethereum/src/network.rs` to accommodate dynamic weighting. This enhancement builds upon the existing static weighted RPC steering, allowing for more adaptive and robust RPC management. Fixes #6126 * bump: tokio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces dynamic weight adjustment for RPC providers, improving failover and resilience by adapting to real-time provider health. The system now dynamically adjusts provider selection weights based on health metrics including latency, error rates, and consecutive failures.
This enhancement builds upon the static weighted RPC steering implemented in #6126, making the RPC management more adaptive and robust.
Changes
Core Implementation
chain/ethereum/src/health.rs): New module to track RPC provider health metricsIntegration Points
Dynamic Weight Adjustment (
chain/ethereum/src/network.rs): Integrated health metrics into provider selection logicHealth Checker Initialization (
node/src/network_setup.rs): Setup and management of health checkers for Ethereum RPC adaptersDependencies
tokiodependency tochain/ethereumandnodecrates for asynchronous health checksTesting
chain/ethereum/src/network.rsto accommodate dynamic weighting behaviorRelated Issues
Builds on #6126 - Weighted RPC load balancing
Test Plan
Closes OPS-727
🤖 Generated with Claude Code